import React from 'react';
import { connect } from 'dva';
import { Helmet } from 'react-helmet';
import styles from './Help.less';

class HelpContent extends React.Component {

  componentDidMount() {
    window.scrollTo(0, 0);
  }

  render() {
    const { content } = this.props.help;

    return (
      <div title="常见问题">
        <Helmet>
          <title>
            常见问题
          </title>
        </Helmet>

        <div className={styles.content}>
          <div className={styles.question}>
            <span className={styles.line} />
            {content.question}
          </div>
          <div className={styles.answer} dangerouslySetInnerHTML={{ __html: content.answer }} />
        </div>
      </div>
    );
  }
}

export default connect(({ help }) => ({ help }))(HelpContent);
